/**
 * @author MIAO
 * Created on 2011-10-9
 * For more information, please visit:ismiao.com
 */
package com.ismiao.designPattern.Observer;

import java.util.Observable;
//被观察者
public class BeingWatched extends Observable {
	void counter(int period){
		for(;period>=0;period--){
			setChanged();
			notifyObservers(period);
			try{
				Thread.sleep(1000);
			}catch (InterruptedException e){
				System.out.println("Sleep interrupted");
			}
		}
	}
}
